package com.lantosec.hmrp.modules.system.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseVO;
import com.lantosec.hmrp.modules.system.entity.SysLoginLog;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 *  VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-02-19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="SysLoginLog对象", description="")
public class SysLoginLogVO extends BaseVO<SysLoginLog> {
    private static final long serialVersionUID = 1L;


    public SysLoginLogVO(SysLoginLog entity){
        this.logId = entity.getLogId();
        this.logIp = entity.getLogIp();
        this.logUserId = entity.getLogUserId();
        this.logTime = entity.getLogTime();
    }

    @Override
    public SysLoginLog convertToEntity(){
        return new SysLoginLog(this);
    }


    @ApiModelProperty(value = "日志ID")
    @TableId(value = "log_id", type = IdType.AUTO)
    private String logId;

    @ApiModelProperty(value = "ip地址")
    private String logIp;

    @ApiModelProperty(value = "操作人")
    private String logUserId;

    @ApiModelProperty(value = "操作时间")
    private Date logTime;

    @ApiModelProperty(value = "用户名")
    private String userName;


    @ApiModelProperty(value = "开始时间")
    private String startTime;

    @ApiModelProperty(value = "结束时间")
    private String endTime;
}
